package com.lhb.boyixue.user.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class ConversationContext {
    private String sessionId;
    private List<String> summaryHistory = new ArrayList<>();
    private List<ChatMessage> recentMessages = new ArrayList<>();
    
    public void addToSummary(String summary) {
        summaryHistory.add(summary);
        // 限制摘要数量
        if (summaryHistory.size() > 5) {
            summaryHistory.remove(0);
        }
    }
    
    public void removeOldMessages(List<ChatMessage> oldMessages) {
        recentMessages.removeAll(oldMessages);
    }
}